package com.heisenhub.file.hander;

import com.heisnenhub.common.module.handler.BaseExceptionHandler;
import com.heisnenhub.common.module.utils.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.MissingServletRequestParameterException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @author sen
 * @description  全局异常处理器
 * @date 2023/12/18 11:06
 */
@RestControllerAdvice
@Slf4j
public class GlobalExceptionHandler extends BaseExceptionHandler {




    @ExceptionHandler(value = MissingServletRequestParameterException.class)
    public Api MissingServletRequestParameterException(MissingServletRequestParameterException e) {
        log.info("【MissingServletRequestParameterException】 {}" ,e);
        return Api.fail(e.getMessage());
    }



}